//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.wsd.smartcarwasher.dao;

import com.wsd.smartcarwasher.domain.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;

import java.util.Date;
import java.util.List;

public interface CardDao {
    int addCard(Card card) throws DataAccessException;

    int addService(@Param("service")WashServiceWithTimes service,@Param("cardId") int cardId) throws DataAccessException;

    List<Card> queryAllCards() throws DataAccessException;

    List<Card> queryCardsWithStatus(@Param("status") Integer status) throws DataAccessException;

    int updateCardStatus(@Param("id") int id, @Param("status") int status) throws DataAccessException;

    int updateCard(Card card) throws DataAccessException;

    Card queryCardByCardId(int cardId) throws DataAccessException;

    List<UserCard> queryUserCards(String userId) throws DataAccessException;

    int bindCardToUser(UserCard userCard) throws DataAccessException;
    int bindRateCardToUser(UserCard userCard) throws DataAccessException;

    List<UserCard> queryUserCard(String userId, int cardId) throws DataAccessException;

    int updateLeftTimes(@Param("userId") String userId, @Param("cardId") int cardId, @Param("serviceId") int serviceId, @Param("leftTimes") int leftTimes, @Param("validDate") Date validDate) throws DataAccessException;

    UserCard queryUserCardByServiceId(@Param("userId")String userId, @Param("cardId")int cardId, @Param("serviceId")int serviceId, @Param("ucId")String ucId);

    int updateLeftTimesByUCId(@Param("userId")String userId, @Param("cardId")int cardId, @Param("serviceId")int serviceId, @Param("ucId")String ucId);

    int deleteUserCard(@Param("userId")String userId,@Param("ucId") String ucId);

    List<Card> queryAllCardPc() throws DataAccessException;

    List<UserCard> queryUserCardByUcId(@Param("ucId") String ucId) throws DataAccessException;

    int rollBackUserCard(OrderInfo order);
    int rollUserCard(CardOrder cardOrder);
    List<UserCardEntity> queryUserDiscountCards(@Param("userId")String userId,@Param("type") Integer type,@Param("serviceId") Integer serviceId,@Param("machineId") String machineId);

    Card queryCardActivity(Integer cardId);
}
